import service from '../utils/request.js'; // 引入二次封装的 axios

// 公告信息管理
export const addAnnouncement = (announcement) => {
    return service.post('/api/admin/announcement/add', announcement);
};

export const deleteAnnouncementById = (id) => {
    return service.post(`/api/admin/announcement/delete/${id}`);
};

export const getAnnouncementById = (id) => {
    return service.get(`/api/admin/announcement/detail/${id}`);
};

export const listAnnouncements = (params) => {
    return service.post('/api/admin/announcement/list', params);
};

export const updateAnnouncement = (announcement) => {
    return service.post('/api/admin/announcement/update', announcement);
};

export const getHomePageList = () => {
    return service.get('/api/admin/announcement/homePageList');
};

export const deleteAnnouncementBeach = (ids) => {
    return service.post(`/api/admin/announcement/batchDelete`,ids);
};